package com.xm.biz.impl;

import com.xm.biz.FavoritesBiz;
import com.xm.dao.FavoritesDao;
import com.xm.dao.impl.FavoritesDaoImpl;
import com.xm.po.Favorites;

import java.util.List;

/**
 * @author xie'lin'feng
 * @date 2020-08-25-16:05
 * @description 商品收藏业务逻辑层实现类
 */
public class FavoritesBizImpl implements FavoritesBiz {
    FavoritesDao favoritesDao = new FavoritesDaoImpl();
    @Override
    public List<Favorites> getAll(Integer userId) {
        return favoritesDao.getAll(userId);
    }

    @Override
    public Favorites check(Integer goodsId, Integer userId) {
        return favoritesDao.check(goodsId,userId);
    }

    @Override
    public boolean add(Favorites favorites) {
        return favoritesDao.add(favorites);
    }

    @Override
    public boolean update(Favorites favorites) {
        return favoritesDao.update(favorites);
    }

    @Override
    public boolean deleteById(Integer id) {
        return favoritesDao.deleteById(id);
    }
}
